package main

import (
	"fmt"
	"github.com/fatih/structs"
)

type AdvertCreateRequest struct {
	Title  string `json:"title" binding:"required"  msg:"标题" structs:"title"`
	Href   string `json:"href" binding:"required,url"  msg:"跳转地址" structs:"-"` // 跳转地址 url 规定必须是一个有效地址
	Images string `json:"images" binding:"required,url"  msg:"图片"`             // 图片地址
	IsShow bool   `json:"is_show" binding:"required"  msg:"布尔值"`
}

func main() {
	a := AdvertCreateRequest{
		Title:  "title",
		Href:   "Href",
		Images: "aaa",
		IsShow: true,
	}
	m := structs.Map(a)
	fmt.Println(m)
}
